package com.itheima.encapsulation;

public class Student {
    private double score;

    public void setScore(double score) {

        if(score > 0&& score <= 100){
            this.score = score;
        }else {
            System.out.println("成绩必须在0-100之间");
        }
    }

    public double getScore(){
        return score;
    }

    public void printPass(){
        System.out.println(score >= 60 ? "及格" : "不及格");
    }
}
